/*
子弹的ai，完成子弹的所有任务
*/
package controller.behavior;

import model.BulletModel;
import model.Model;
import util.Direction;
import view.BulletView;
import view.ModelView;

public class BulletAI implements Behavior {
    private BulletModel bulletModel;
    private BulletView bulletView;

    public BulletAI(BulletModel bulletModel, BulletView bulletView) {
        this.bulletModel = bulletModel;
        this.bulletView = bulletView;
    }

    @Override
    public BulletModel fire(boolean isfire) {
        // 子弹不需要开火
        return null;
    }

    @Override
    public Direction move(boolean ismove) {
        if (ismove) {
            return bulletView.getFace();
        } else
            return null;
    }

    @Override
    public void stay() {
        // 子弹没有stay指令
    }

    @Override
    public ModelView getView() {
        return bulletView;
    }

    @Override
    public Model getModel() {
        return bulletModel;
    }

    @Override
    public boolean isLife() {
        return true;
    }

}
